home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / music / ptsupp.lha / PT Support archive / Sources / PTCustomize.S < prev    next >
Text File  |  1996-01-30  |  2KB  |  93 lines

  1.  
  2. ; ProTracker custom manual release 1
  3. ; © 1996 Mental Diseases
  4. ; By: Håvard "Howard/Mental Diseases" Pedersen
  5. ; Idea: Stein Engelsgjerd
  6.  
  7. ; WARNING:
  8.  
  9. ; This haven't been tested, and no warranties are neither implied or given.
  10.  
  11. ; SAMPLES:
  12.  
  13. ; All empty samples must have samplepointers pointing to one empty word,
  14. ; located in chipmem. And replen for these samples must be set to 1.
  15.  
  16. ; SAMPLE POINTERS:
  17.  
  18. ; In order to prevent the playroutine from building it's own samplepointers,
  19. ; you must delete everything from the label .SampleProc to (and including) the
  20. ; line "dbra d0,PT_loop3". This has the sideeffect that the playroutine no
  21. ; longer clears the first word of each sample in use. The caller must now do
  22. ; this himself.
  23.  
  24. ; PATTERNS:
  25.  
  26. ; To fetch a step from a pattern into D0, do this:
  27.  
  28.         lea.l    PT_MainData+PTm_PatternPtrs(pc),a0
  29.         move.l    pnum*4(a0),a0
  30.         move.l    step*16+channel*4(a0),d0
  31.  
  32. ; pnum = pattern number (0-255)
  33. ; step = pattern step (0-63)
  34. ; channel = channel to fetch from (0-3)
  35.  
  36. ; To get the samplerate:
  37.  
  38.         swap    d0
  39.         and.l    #$fff,d0
  40.  
  41. ; To get the samplenumber: (This may be optimized by combining with fetching
  42. ; the data from the pattern, since this allows byte accesses.)
  43.  
  44.         swap    d0
  45.         move.w    d0,d1
  46.         rol.w    #8,d1
  47.         and.l    #$00f0,d1
  48.         rol.l    #4,d0
  49.         and.l    #$000f,d0
  50.         or.l    d1,d0
  51.  
  52. ; To get the effectcommand:
  53.  
  54.         and.l    #$fff,d0
  55.         
  56. ; PATTERN POINTERS:
  57.  
  58. ; For reserving space for samplepointers, insert the following right under
  59. ; PTm_SamplePtrs in the maindata structure:
  60.  
  61. PTm_PatternPtrs    rs.l    256
  62.  
  63. ; If your application support less than 256 patterns, you can safely exchange
  64. ; 256 with the numbers of patterns your application support.
  65.  
  66. ; Still, you'd need to generate your own patternpointers. You have to do this
  67. ; yourself and store them in the maindata structure. In order to make the
  68. ; replay use your patternpointers, exchange all code from PT_getnewnote to (and
  69. ; including "clr.w PTm_DMAConTemp(a4)" with:
  70.  
  71. PT_getnewnote    move.l    PTm_ModulePtr(a4),a0
  72.         lea.l    12(a0),a3
  73.         lea.l    952(a0),a2        ;pattpo
  74.         lea.l    PTm_PatternPtrs(a0),a0    ;patternarray
  75.         moveq.l    #0,d0
  76.         moveq.l    #0,d1
  77.         move.b    PTm_SongPos(a4),d0
  78.         move.b    (a2,d0.w),d1
  79.     ifeq PT__68020
  80.         lsl.l    #2,d1
  81.         move.l    (a0,d1.w),a0        ; Fetch pointer
  82.     else
  83.         move.l    (a0,d1.w*4),a0        ; Fetch pointer
  84.     endc
  85.         moveq.l    #0,d1            ; clear offset
  86.         add.w    PTm_PattPos(a4),d1
  87.         clr.w    PTm_DMAConTemp(a4)
  88.  
  89. ; GENERAL:
  90.  
  91. ; All pointers must be built BEFORE calling PT_Init.
  92.  
  93.